// 订单
import http from '../request'
// 添加订单(需要token)
export function addOrderApi(data){
  return http({
    method:'POST',
    url:'/api/shop/order',
    data
  })
}
// 获取订单列表(需要token)
export function getOrdersApi(params){
  return http({
    method:'GET',
    url:'/api/shop/order',
    params
  })
}
// 获取订单单条信息(需要token)
export function getOrderApi(id){
  return http({
    method:'GET',
    url:`/api/shop/order/${id}`,
  })
}
// 删除订单
export function delOrderApi(id){
  return http({
    method:'DELETE',
    url:`/api/shop/order/${id}`,
  })
}
// 支付订单
export function payOrderApi(data){
  return http({
    method:'POST',
    url:`/api/shop/orderpay`,
    data
  })
}
// 更新订单信息
export function updateOrderApi(id,data){
  return http({
    method:'PUT',
    url:`/api/shop/order/${id}`,
    data
  })
}